package xyz.lisys.boot.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration
public class SwaggerConfigurer {

    @Bean
    public Docket docket() {
        return new Docket(DocumentationType.OAS_30)
                .apiInfo(
                        new ApiInfoBuilder()
                                .title("Swagger3集成SpringBoot2.7 - demo示例")
                                .description("springboot | swagger")
                                .contact(new Contact("SystemLight", "http://lisys.club", "SystemLight@qq.com"))
                                .version("1.0.0")
                                .build()
                )
                .enable(true)
                .pathMapping("/")
                .select()
                .apis(RequestHandlerSelectors.basePackage("xyz.lisys.boot.controller"))
                .paths(PathSelectors.any())
                .build();
    }
}
